package com.eudon.design_pattern.behavioral.mediator;

/**
 * @author eudon
 * @description 抽象用户类
 * @date 2025/9/3
 * @email syd19970616@gmail.com
 * @address <a href="https://gitee.com/eudon">Gitee</a>
 */
public abstract class User {
    protected String name;
    protected Mediator mediator;
    
    public User(String name, Mediator mediator) {
        this.name = name;
        this.mediator = mediator;
    }
    
    /**
     * 发送消息
     * @param message 消息内容
     */
    public abstract void sendMessage(String message);
    
    /**
     * 接收消息
     * @param message 消息内容
     * @param from 发送者姓名
     */
    public abstract void receiveMessage(String message, String from);
    
    public String getName() {
        return name;
    }
}